import request from "@/utils/request"

export interface ExamPaperAnswerItem {
  id: number
  examName: string
  username: string
  score: string
  correctQuestions: string
  duration: string
  submitTime: string
}

export interface ExamPaperAnswerQuery {
  subject?: string
  pageIndex: number
  pageSize: number
}

export interface ExamPaperAnswerListResult {
  list: ExamPaperAnswerItem[]
  total: number
}

// 答卷列表API
export async function fetchExamPaperAnswerPage(params: ExamPaperAnswerQuery): Promise<ExamPaperAnswerListResult> {
  const res = await request.post<ExamPaperAnswerListResult>("/api/admin/examPaperAnswer/page", params)
  return res.data.data
}